<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<table>
		<tr><th>id</th><th>用户名</th><th>密码</th><th>权限</th></tr>
		<c:forEach items="${userList }" var="user">
			<tr><td>${pageInfo.startRow }</td><td>${user.username }</td><td>${user.password }</td><td>${user.permissions }</td></tr>
		</c:forEach>
	</table>
	<!-- 分页信息 -->
        <div class="row">
            <!-- 分页文字信息，其中分页信息都封装在pageInfo中 -->
            <div class="col-md-6">
                当前第：${pageInfo.pageNum}页，总共：${pageInfo.pages}页，总共：${pageInfo.total}条记录
            </div>
        <!-- 分页条 -->
            <div class="col-md-6">
                   <a href="${pageContext.request.contextPath}/showUser.do?pn=1">首页</a>
                    <c:if test="${pageInfo.hasPreviousPage }">
                        
                          <a href="${pageContext.request.contextPath}/showUser.do?pn=${pageInfo.pageNum-1}">
                            <span aria-hidden="true">&laquo;</span>
                          </a>
                        
                    </c:if>
                    <c:forEach items="${pageInfo.navigatepageNums }" var="page_Num">
                        <c:if test="${page_Num == pageInfo.pageNum }">
                           <a href="#">${ page_Num}</a>
                        </c:if>
                        <c:if test="${page_Num != pageInfo.pageNum }">
                            <a href="${pageContext.request.contextPath}/showUser.do?pn=${ page_Num}">${ page_Num}</a>
                        </c:if>
                    </c:forEach>
                    <c:if test="${pageInfo.hasNextPage }">
                      
                          <a href="${pageContext.request.contextPath}/showUser.do?pn=${pageInfo.pageNum+1}">
                            <span aria-hidden="true">&raquo;</span>
                          </a>
                        
                    </c:if>  
                   <a href="${pageContext.request.contextPath}/showUser.do?pn=${pageInfo.pages}">末页</a>
                  
               
            </div>
        </div>
</body>
</html>